Python: Support a (ASCII) inline regex flag - #15390
Conversation
| #Group with inline flags | ||
| re.compile("(?aimsx:a+)") | ||
| re.compile("(?-imsx:a+)") | ||
| re.compile("(?a-imsx:a+)") |
There was a problem hiding this comment.
The - and : in these are not properly handled yet (and therefore some of the .expected entries are incorrect). Should I omit these?
There was a problem hiding this comment.
We should modify the .expected files to make the tests pass.
you could simply add a comment to this test file (either on line 62 or on each of 63-65) noting that this is not handled correctly.
The machinery to both log your actual expectation and have the test pass does exist in the form of inline expectation tests (where you can write MISSING and SPURIOUS). If you want to go down that route instead, see GroupTest in SubstructureTests.ql and groupTest.py.
There was a problem hiding this comment.
We should modify the
.expectedfiles to make the tests pass.
I think the tests should pass in their current form, but please let me know if I overlooked something. What I meant was rather that these results are not really 'expected' but just happen to represent the current (slightly incorrect) parsing results.
Thanks for the hint with inline expectation tests; for now I just added a TODO comment in test.py, I hope that is ok.
681e9d3 to
1ad08ef
Compare
Split off from #15345, see description and comments there